# -*- coding: utf-8 -*-
from django import template
from djwatch.models import Server, ServerGroup

register = template.Library()

@register.inclusion_tag('elems/servers_list.html', takes_context=True)
def servers_list(context):
    servers = Server.objects.filter()
    server_groups = ServerGroup.objects.filter()
    return {
        'servers': servers,
        'server_groups': server_groups,
        'current_server': context.get('server'),
    }
